import java.util.Scanner;

public class problem1 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int q = in.nextInt();
        int a, b, c;
        while(q-- != 0) {
            a = in.nextInt();
            b = in.nextInt();
            c = in.nextInt();
            int x = Math.min(a,Math.min(b,c));
            System.out.println(x * 2  + Math.max(b - x - 1,0));
        }
    }
}
